negotiator
Class SerializeHandling

java.lang.Object
  extended by negotiator.SerializeHandling

public class SerializeHandling
extends java.lang.Object

This is a utility class to handle writing and reading Serializable objects into/from a file.

Author:
Samanta H.

Constructor Summary
SerializeHandling()
           
 
Method Summary
static java.io.Serializable readFromDisc(java.lang.String path)
          Reads an Object from the "path" in the disc.
static boolean writeToDisc(java.io.Serializable data, java.lang.String path)
          Writes the data into disc, in a new file under the path given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializeHandling

public SerializeHandling()
Method Detail

writeToDisc

public static boolean writeToDisc(java.io.Serializable data,
                                  java.lang.String path)
Writes the data into disc, in a new file under the path given.

Parameters:
data - the object to be saved into a new file.
path - the final path (including the name of the file which will be created).
Returns:
true if writing the object into the path was successful. false otherwise.

readFromDisc

public static java.io.Serializable readFromDisc(java.lang.String path)
Reads an Object from the "path" in the disc.

Parameters:
path - the path where the object is saved in the disc.
Returns:
the object saved in path.